package com.mjh.zhujianju.config;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.livew.framework.interceptor.PermissionInterceptor;

@Component
public class MVCConfig extends WebMvcConfigurerAdapter{

	 @Bean
	    public PermissionInterceptor securityInterceptor() {
	        return new PermissionInterceptor();
	    }

	    @Override
	    public void addInterceptors(InterceptorRegistry registry) {
	    registry.addInterceptor(securityInterceptor()).excludePathPatterns("/static/*").excludePathPatterns("/image/*")
	                .excludePathPatterns("/error").excludePathPatterns("/403").addPathPatterns("/**");
	    }

}
